﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_panel_Index : System.Web.UI.Page
{
    BieumauDataContext db = new BieumauDataContext();
    public static int flag = 0;
    
    protected void Page_Load(object sender, EventArgs e)
    {
        flag = 0;
        if (Session["login_admin"] != null)
        {
            Response.Redirect("QuanTriHeThong.aspx");
        }
        
    }
    protected void txtdangnhap_Click(object sender, EventArgs e)
    {
        
            int check = (from p in db.tbltaikhoans where p.TaiKhoan == txttaikhoan.Text.Trim() && p.MatKhau == txtmatkhau.Text.Trim().MD5_pass_kieu1() select p).Count();
            if (check != 0)
            {
                flag = 0;
                Session["login_admin"] = txttaikhoan.Text.Trim();
                Response.Redirect("QuanTriHeThong.aspx");
               
               
            }
            else
            {
                flag = 1;
            }
        
    }
}